import { getDetails } from '@/api/admin/user'

var validateUsername = (rule, value, callback) => {
  getDetails(value).then(response => {
    if (window.boxType === 'edit') callback()
    let result = response.data.data
    if (result !== null) {
      callback(new Error('用户名已经存在'))
    } else {
      callback()
    }
  })
}
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  viewBtn:true,
  column: [
    {
    fixed: true,
    label: '机房Id',
    prop: 'roomid',
    span: 24,
    editDisabled: true,
    addVisdiplay: false
  }, {
    label: '机房名称',
    prop: 'roomname',
    overHidden: true,
    addVisdiplay: false,
    editVisdiplay: false,
    span: 24,
  },
    {
      label: '中断统计',
      prop: 'interruptcount',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    },
    {
      label: '设备统计',
      prop: 'devicecount',
      overHidden: true,
      addVisdiplay: false,
      editVisdiplay: false,
      span: 24,
    }
  ]
}
